package tech.xs.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tech.xs.dao.ClaimVoucherDao;
import tech.xs.pojo.ClaimVoucher;
import tech.xs.pojo.Employee;
import tech.xs.service.ClaimVoucherService;


@Service
public class ClaimVoucherServiceImpl implements ClaimVoucherService {

	@Autowired 
	private ClaimVoucherDao claimVoucherDao;

	@Override
	public List<ClaimVoucher> findlist(Employee employee, ClaimVoucher voucher, Date date1, Date date2, int pageNo,
			int pageSize) {
		// TODO Auto-generated method stub
		return claimVoucherDao.findlist(employee, voucher, date1, date2, pageNo, pageSize);
	}

	@Override
	public int count(Employee employee, ClaimVoucher voucher, Date date1, Date date2) {
		// TODO Auto-generated method stub
		return claimVoucherDao.count(employee, voucher, date1, date2);
	}

	@Override
	public List<String> selectStatus() {
		// TODO Auto-generated method stub
		return claimVoucherDao.selectStatus();
	}

	@Override
	public void delete(ClaimVoucher voucher) {
		// TODO Auto-generated method stub
		claimVoucherDao.delete(voucher);
	}

	@SuppressWarnings("unused")
	@Override
	public boolean save(ClaimVoucher claimVoucher) {
		// TODO Auto-generated method stub
		boolean flag=false;
		if (claimVoucher !=null) {
			claimVoucherDao.save(claimVoucher);
			flag=true;
		}
		return false;
	}

	@Override
	public ClaimVoucher findById(long id) {
		// TODO Auto-generated method stub
		return claimVoucherDao.findById(id);
	}

	@Override
	public boolean update(ClaimVoucher claimVoucher) {
		// TODO Auto-generated method stub
		boolean flag = false;
		if(claimVoucher!=null) {
			claimVoucherDao.update(claimVoucher);
			flag = true;
		}	
		return flag;
	}

	
}
